/*
 * @Author: your name
 * @Date: 2021-04-28 16:26:43
 * @LastEditTime: 2021-04-28 16:38:02
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /qugame/work-admin/src/excel/util.js
 */
export function export2Excel (columns, list, name) {
  require.ensure([], () => {
      const { export_json_to_excel } = require('./Export2Excel')
      let tHeader = []
      let filterVal = []
      console.log(columns, 22)
      if (!columns) {
          return
      }
      columns.forEach(item => {
          tHeader.push(item.title)
          filterVal.push(item.key)
      })
      const data = list.map(v => filterVal.map(j => v[j]))
      export_json_to_excel(tHeader, data, name)
  })
}
